<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>error C2064: term does not evaluate to a function taking 2 arguments</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Python">
<link rel="up" href="../faq.html" title="Chapter 5. Frequently Asked Questions (FAQs)">
<link rel="prev" href="how_do_i_create_sub_packages_usi.html" title="How do I create sub-packages using Boost.Python?">
<link rel="next" href="how_can_i_automatically_convert_.html" title="How can I automatically convert my custom string type to and from a Python string?">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="" width="" height="" src="../images/boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="how_do_i_create_sub_packages_usi.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../faq.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="how_can_i_automatically_convert_.html"><img src="../images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="faq.error_c2064_term_does_not_evalua"></a><a class="link" href="error_c2064_term_does_not_evalua.html" title="error C2064: term does not evaluate to a function taking 2 arguments">error C2064: term
      does not evaluate to a function taking 2 arguments</a>
</h3></div></div></div>
<p>
        <span class="emphasis"><em>Niall Douglas provides these notes:</em></span>
      </p>
<p>
        If you see Microsoft Visual C++ 7.1 (MS Visual Studio .NET 2003) issue an
        error message like the following it is most likely due to a bug in the compiler:
      </p>
<pre class="programlisting"><span class="identifier">boost</span><span class="special">\</span><span class="identifier">boost</span><span class="special">\</span><span class="identifier">python</span><span class="special">\</span><span class="identifier">detail</span><span class="special">\</span><span class="identifier">invoke</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">(</span><span class="number">76</span><span class="special">):</span>
<span class="identifier">error</span> <span class="identifier">C2064</span><span class="special">:</span> <span class="identifier">term</span> <span class="identifier">does</span> <span class="keyword">not</span> <span class="identifier">evaluate</span> <span class="identifier">to</span> <span class="identifier">a</span> <span class="identifier">function</span> <span class="identifier">taking</span> <span class="number">2</span> <span class="identifier">arguments</span><span class="error">"</span>
</pre>
<p>
        This message is triggered by code like the following:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">python</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">python</span><span class="special">;</span>

<span class="keyword">class</span> <span class="identifier">FXThread</span>
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="keyword">bool</span> <span class="identifier">setAutoDelete</span><span class="special">(</span><span class="keyword">bool</span> <span class="identifier">doso</span><span class="special">)</span> <span class="keyword">throw</span><span class="special">();</span>
<span class="special">};</span>

<span class="keyword">void</span> <span class="identifier">Export_FXThread</span><span class="special">()</span>
<span class="special">{</span>
  <span class="identifier">class_</span><span class="special">&lt;</span> <span class="identifier">FXThread</span> <span class="special">&gt;(</span><span class="string">"FXThread"</span><span class="special">)</span>
      <span class="special">.</span><span class="identifier">def</span><span class="special">(</span><span class="string">"setAutoDelete"</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">amp</span><span class="special">;</span><span class="identifier">FXThread</span><span class="special">::</span><span class="identifier">setAutoDelete</span><span class="special">)</span>
  <span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
        The bug is related to the <code class="computeroutput"><span class="keyword">throw</span><span class="special">()</span></code> modifier. As a workaround cast off the
        modifier. E.g.:
      </p>
<pre class="programlisting"><span class="special">.</span><span class="identifier">def</span><span class="special">(</span><span class="string">"setAutoDelete"</span><span class="special">,</span> <span class="special">(</span><span class="keyword">bool</span> <span class="special">(</span><span class="identifier">FXThread</span><span class="special">::*)(</span><span class="keyword">bool</span><span class="special">))</span> <span class="special">&amp;</span><span class="identifier">FXThread</span><span class="special">::</span><span class="identifier">setAutoDelete</span><span class="special">)</span>
</pre>
<p>
        (The bug has been reported to Microsoft.)
      </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2015 David
      Abrahams, Stefan Seefeld<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="how_do_i_create_sub_packages_usi.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../faq.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="how_can_i_automatically_convert_.html"><img src="../images/next.png" alt="Next"></a>
</div>
</body>
</html>
